import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token.js'

// 片区树状查询的函数
export const districtTreeQueryService = (rootId) => {
    // 发送HTTP GET请求到后端API，获取片区及其下级片区的树状结构
    return request.get('/admin/district/tree/' + rootId)
}

//提供调用分页查询接口的函数
export const districtPageQueryService = (params)=>{
    return request.get('/admin/district/page',{params: params});
}
//修改信息
export const districtInfoUpdateService = (userInfoData)=>{
    return request.put('/admin/district',userInfoData)
}

 //修改信息
export const districtDeleteService = (id)=>{
    return request.delete('/admin/district/' + id)
 }

  //获取信息
export const districtInfoGetService = (id)=>{
    return request.get('/admin/district/' + id)
}

  //获取信息
  export const districtRegisterService = (registerData)=>{
    return request.post('/admin/district/add', registerData)
}

  //获取全名
  export const districtGetFullNameService = (id)=>{
    return request.get('/admin/district/' + id + '/linkString')
}